/*
Compare differences in group-specific estimates for gender
Male-Female
*/

// Make empty files for putting results in later

clear all
gen str32 vble = ""
foreach v in d_empt_tau0tau6 d_empt_tau1tau6 d_empt_pre1pre6 d_empt_pre3pre6 ///
	d_empt_tau0 d_empt_tau1 d_empt_tau2 d_empt_tau3 d_empt_tau4 ///
	d_empt_tau5 d_empt_tau6 d_empt_d_ATT  ///
	d_wgt_tau0tau6 d_wgt_tau1tau6 d_wgt_pre1pre6 d_wgt_pre3pre6 ///
	d_wgt_tau0 d_wgt_tau1 d_wgt_tau2 d_wgt_tau3 d_wgt_tau4 ///
	d_wgt_tau5 d_wgt_tau6 d_wgt_d_ATT  ///
	d_empc_tau0tau6 d_empc_tau1tau6 d_empc_pre1pre6 d_empc_pre3pre6 ///
	d_empc_tau0 d_empc_tau1 d_empc_tau2 d_empc_tau3 d_empc_tau4 ///
	d_empc_tau5 d_empc_tau6 d_empc_d_ATT  ///
	d_wgc_tau0tau6 d_wgc_tau1tau6 d_wgc_pre1pre6 d_wgc_pre3pre6 ///
	d_wgc_tau0 d_wgc_tau1 d_wgc_tau2 d_wgc_tau3 d_wgc_tau4 ///
	d_wgc_tau5 d_wgc_tau6 d_wgc_d_ATT {
	gen double `v' = .
}

drop if _n>0
save "/projects/users/########/Snapshot2022/Results/male_female_compare.dta", replace

************************************
* College-Some College Comparison
************************************

// Read and organize data from each gender

clear all
use "/projects/users/########/Snapshot2022/Results/lpdid2_strateq2_male2.dta"

keep vble b_*
rename b_emp20bscpl0 b_empt_male
rename b_emp20cbscpl0 b_empc_male
rename b_wg20bscpl0 b_wgt_male
rename b_wg20cbscpl0 b_wgc_male
gen index = _n

tempfile male_estimates
save `male_estimates'

use "/projects/users/########/Snapshot2022/Results/lpdid2_strateq2_female2.dta", clear

keep vble b_*
rename b_emp20bscpl0 b_empt_female
rename b_emp20cbscpl0 b_empc_female
rename b_wg20bscpl0 b_wgt_female
rename b_wg20cbscpl0 b_wgc_female
gen index = _n

merge 1:1 index using `male_estimates'
keep if _merge==3

gen d_empt = b_empt_male - b_empt_female
gen d_wgt = b_wgt_male - b_wgt_female
gen d_empc = b_empc_male - b_empc_female
gen d_wgc = b_wgc_male - b_wgc_female

// Create tempfile to hold results of comparisons

capture postutil clear
tempfile male_fem
postfile handle str32 vble double ///
	d_empt_tau0tau6 d_empt_tau1tau6 d_empt_pre1pre6 d_empt_pre3pre6 ///
	d_empt_tau0 d_empt_tau1 d_empt_tau2 d_empt_tau3 d_empt_tau4 ///
	d_empt_tau5 d_empt_tau6 d_empt_d_ATT  ///
	d_wgt_tau0tau6 d_wgt_tau1tau6 d_wgt_pre1pre6 d_wgt_pre3pre6 ///
	d_wgt_tau0 d_wgt_tau1 d_wgt_tau2 d_wgt_tau3 d_wgt_tau4 ///
	d_wgt_tau5 d_wgt_tau6 d_wgt_d_ATT  ///
	d_empc_tau0tau6 d_empc_tau1tau6 d_empc_pre1pre6 d_empc_pre3pre6 ///
	d_empc_tau0 d_empc_tau1 d_empc_tau2 d_empc_tau3 d_empc_tau4 ///
	d_empc_tau5 d_empc_tau6 d_empc_d_ATT  ///
	d_wgc_tau0tau6 d_wgc_tau1tau6 d_wgc_pre1pre6 d_wgc_pre3pre6 ///
	d_wgc_tau0 d_wgc_tau1 d_wgc_tau2 d_wgc_tau3 d_wgc_tau4 ///
	d_wgc_tau5 d_wgc_tau6 d_wgc_d_ATT  ///
	using `male_fem', replace

// Calculate comparisons and store in a matrix

foreach var of varlist d_empt d_wgt d_empc d_wgc {
	matrix comps = J(12,4,.)
	matrix colnames comps = Num MeanDiff PctPos PctNeg
	
	summ `var' if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6"), det
	matrix comps[1,1] = r(N)
	matrix comps[1,2] = r(mean)
	summ `var' if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & `var'>0
	matrix comps[1,3] = r(N)/comps[1,1]
	summ `var' if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & `var'<0
	matrix comps[1,4] = r(N)/comps[1,1]
	
	summ `var' if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6"), det
	matrix comps[2,1] = r(N)
	matrix comps[2,2] = r(mean)
	summ `var' if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & `var'>0
	matrix comps[2,3] = r(N)/comps[2,1]
	summ `var' if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & `var'<0
	matrix comps[2,4] = r(N)/comps[2,1]	
	
	summ `var' if inlist(vble,"pre1","pre3","pre4","pre5","pre6"), det
	matrix comps[3,1] = r(N)
	matrix comps[3,2] = r(mean)
	summ `var' if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & `var'>0
	matrix comps[3,3] = r(N)/comps[3,1]
	summ `var' if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & `var'<0
	matrix comps[3,4] = r(N)/comps[3,1]

	summ `var' if inlist(vble,"pre3","pre4","pre5","pre6"), det
	matrix comps[4,1] = r(N)
	matrix comps[4,2] = r(mean)
	summ `var' if inlist(vble,"pre3","pre4","pre5","pre6") & `var'>0
	matrix comps[4,3] = r(N)/comps[4,1]
	summ `var' if inlist(vble,"pre3","pre4","pre5","pre6") & `var'<0
	matrix comps[4,4] = r(N)/comps[4,1]
	
	foreach num of numlist 0/6 {
		summ `var' if inlist(vble,"tau`num'"), det
		matrix comps[5+`num',1] = r(N)
		matrix comps[5+`num',2] = r(mean)
		summ `var' if inlist(vble,"tau`num'") & `var'>0
		matrix comps[5+`num',3] = r(N)/comps[5+`num',1]
		summ `var' if inlist(vble,"tau`num'") & `var'<0
		matrix comps[5+`num',4] = r(N)/comps[5+`num',1]
	}
	
	matrix rownames comps = ///
		`var'_tau0tau6 `var'_tau1tau6 `var'_pre1pre6 `var'_pre3pre6 ///
		`var'_tau0 `var'_tau1 `var'_tau2 `var'_tau3 `var'_tau4 ///
		`var'_tau5 `var'_tau6 `var'_d_ATT 
		
	matrix male_fem_`var' = (comps)
	matrix drop comps
}
	
// Export the matrix values to the temp file and save a permanent file

foreach v in Num MeanDiff PctPos PctNeg {
	post handle ("`v'") ///
	(male_fem_d_empt["d_empt_tau0tau6", "`v'"]) ///
	(male_fem_d_empt["d_empt_tau1tau6", "`v'"]) ///
	(male_fem_d_empt["d_empt_pre1pre6", "`v'"]) ///
	(male_fem_d_empt["d_empt_pre3pre6", "`v'"]) ///
	(male_fem_d_empt["d_empt_tau0", "`v'"]) (male_fem_d_empt["d_empt_tau1", "`v'"]) ///
	(male_fem_d_empt["d_empt_tau2", "`v'"]) (male_fem_d_empt["d_empt_tau3", "`v'"]) ///
	(male_fem_d_empt["d_empt_tau4", "`v'"]) (male_fem_d_empt["d_empt_tau5", "`v'"]) ///
	(male_fem_d_empt["d_empt_tau6", "`v'"]) (male_fem_d_empt["d_empt_d_ATT", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau0tau6", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau1tau6", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_pre1pre6", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_pre3pre6", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau0", "`v'"]) (male_fem_d_wgt["d_wgt_tau1", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau2", "`v'"]) (male_fem_d_wgt["d_wgt_tau3", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau4", "`v'"]) (male_fem_d_wgt["d_wgt_tau5", "`v'"]) ///
	(male_fem_d_wgt["d_wgt_tau6", "`v'"]) (male_fem_d_wgt["d_wgt_d_ATT", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau0tau6", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau1tau6", "`v'"]) ///
	(male_fem_d_empc["d_empc_pre1pre6", "`v'"]) ///
	(male_fem_d_empc["d_empc_pre3pre6", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau0", "`v'"]) (male_fem_d_empc["d_empc_tau1", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau2", "`v'"]) (male_fem_d_empc["d_empc_tau3", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau4", "`v'"]) (male_fem_d_empc["d_empc_tau5", "`v'"]) ///
	(male_fem_d_empc["d_empc_tau6", "`v'"]) (male_fem_d_empc["d_empc_d_ATT", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau0tau6", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau1tau6", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_pre1pre6", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_pre3pre6", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau0", "`v'"]) (male_fem_d_wgc["d_wgc_tau1", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau2", "`v'"]) (male_fem_d_wgc["d_wgc_tau3", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau4", "`v'"]) (male_fem_d_wgc["d_wgc_tau5", "`v'"]) ///
	(male_fem_d_wgc["d_wgc_tau6", "`v'"]) (male_fem_d_wgc["d_wgc_d_ATT", "`v'"]) 
}

postclose handle
preserve
use "/projects/users/########/Snapshot2022/Results/male_female_compare.dta", clear
append using `male_fem'
save "/projects/users/########/Snapshot2022/Results/male_female_compare.dta", replace
restore
	

/*
// Compare binary treatment on employment

gen d_empt = b_empt_male - b_empt_female
hist d_empt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6")
summ d_empt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_empt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_empt>0
summ d_empt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_empt<0
*

hist d_empt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6")
summ d_empt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_empt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_empt>0
summ d_empt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_empt<0
* 

hist d_empt if inlist(vble,"pre1","pre3","pre4","pre5","pre6")
summ d_empt if inlist(vble,"pre1","pre3","pre4","pre5","pre6"), det
summ d_empt if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_empt>0
summ d_empt if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_empt<0
* 
hist d_empt if inlist(vble,"pre3","pre4","pre5","pre6")
summ d_empt if inlist(vble,"pre3","pre4","pre5","pre6"), det
summ d_empt if inlist(vble,"pre3","pre4","pre5","pre6") & d_empt>0
summ d_empt if inlist(vble,"pre3","pre4","pre5","pre6") & d_empt<0
* 


hist d_empt if inlist(vble,"tau0")
summ d_empt if inlist(vble,"tau0"), det
summ d_empt if inlist(vble,"tau0") & d_empt>0
summ d_empt if inlist(vble,"tau0") & d_empt<0
* 

hist d_empt if inlist(vble,"tau1")
summ d_empt if inlist(vble,"tau1"), det
summ d_empt if inlist(vble,"tau1") & d_empt>0
summ d_empt if inlist(vble,"tau1") & d_empt<0
*

hist d_empt if inlist(vble,"tau2")
summ d_empt if inlist(vble,"tau2"), det
summ d_empt if inlist(vble,"tau2") & d_empt>0
summ d_empt if inlist(vble,"tau2") & d_empt<0
*

hist d_empt if inlist(vble,"tau3")
summ d_empt if inlist(vble,"tau3"), det
summ d_empt if inlist(vble,"tau3") & d_empt>0
summ d_empt if inlist(vble,"tau3") & d_empt<0
* 

hist d_empt if inlist(vble,"tau4")
summ d_empt if inlist(vble,"tau4"), det
summ d_empt if inlist(vble,"tau4") & d_empt>0
summ d_empt if inlist(vble,"tau4") & d_empt<0
* 

hist d_empt if inlist(vble,"tau5")
summ d_empt if inlist(vble,"tau5"), det
summ d_empt if inlist(vble,"tau5") & d_empt>0
summ d_empt if inlist(vble,"tau5") & d_empt<0
* 

hist d_empt if inlist(vble,"tau6")
summ d_empt if inlist(vble,"tau6"), det
summ d_empt if inlist(vble,"tau6") & d_empt>0
summ d_empt if inlist(vble,"tau6") & d_empt<0
* 


// Compare binary treatment on earnings

gen d_wgt = b_wgt_male - b_wgt_female
hist d_wgt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6")
summ d_wgt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_wgt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_wgt>0
summ d_wgt if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6")
summ d_wgt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_wgt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_wgt>0
summ d_wgt if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_wgt<0
* 

hist d_wgt if inlist(vble,"pre1","pre3","pre4","pre5","pre6")
summ d_wgt if inlist(vble,"pre1","pre3","pre4","pre5","pre6"), det
summ d_wgt if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_wgt>0
summ d_wgt if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_wgt<0
* 
hist d_wgt if inlist(vble,"pre3","pre4","pre5","pre6")
summ d_wgt if inlist(vble,"pre3","pre4","pre5","pre6"), det
summ d_wgt if inlist(vble,"pre3","pre4","pre5","pre6") & d_wgt>0
summ d_wgt if inlist(vble,"pre3","pre4","pre5","pre6") & d_wgt<0
* 


hist d_wgt if inlist(vble,"tau0")
summ d_wgt if inlist(vble,"tau0"), det
summ d_wgt if inlist(vble,"tau0") & d_wgt>0
summ d_wgt if inlist(vble,"tau0") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau1")
summ d_wgt if inlist(vble,"tau1"), det
summ d_wgt if inlist(vble,"tau1") & d_wgt>0
summ d_wgt if inlist(vble,"tau1") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau2")
summ d_wgt if inlist(vble,"tau2"), det
summ d_wgt if inlist(vble,"tau2") & d_wgt>0
summ d_wgt if inlist(vble,"tau2") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau3")
summ d_wgt if inlist(vble,"tau3"), det
summ d_wgt if inlist(vble,"tau3") & d_wgt>0
summ d_wgt if inlist(vble,"tau3") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau4")
summ d_wgt if inlist(vble,"tau4"), det
summ d_wgt if inlist(vble,"tau4") & d_wgt>0
summ d_wgt if inlist(vble,"tau4") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau5")
summ d_wgt if inlist(vble,"tau5"), det
summ d_wgt if inlist(vble,"tau5") & d_wgt>0
summ d_wgt if inlist(vble,"tau5") & d_wgt<0
* 

hist d_wgt if inlist(vble,"tau6")
summ d_wgt if inlist(vble,"tau6"), det
summ d_wgt if inlist(vble,"tau6") & d_wgt>0
summ d_wgt if inlist(vble,"tau6") & d_wgt<0
* 

// Compare continuous treatment on employment

gen d_empc = b_empc_male - b_empc_female
hist d_empc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6")
summ d_empc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_empc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_empc>0
summ d_empc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_empc<0
* 

hist d_empc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6")
summ d_empc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_empc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_empc>0
summ d_empc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_empc<0
* 

hist d_empc if inlist(vble,"pre1","pre3","pre4","pre5","pre6")
summ d_empc if inlist(vble,"pre1","pre3","pre4","pre5","pre6"), det
summ d_empc if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_empc>0
summ d_empc if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_empc<0
* 
hist d_empc if inlist(vble,"pre3","pre4","pre5","pre6")
summ d_empc if inlist(vble,"pre3","pre4","pre5","pre6"), det
summ d_empc if inlist(vble,"pre3","pre4","pre5","pre6") & d_empc>0
summ d_empc if inlist(vble,"pre3","pre4","pre5","pre6") & d_empc<0
* 


hist d_empc if inlist(vble,"tau0")
summ d_empc if inlist(vble,"tau0"), det
summ d_empc if inlist(vble,"tau0") & d_empc>0
summ d_empc if inlist(vble,"tau0") & d_empc<0
* 

hist d_empc if inlist(vble,"tau1")
summ d_empc if inlist(vble,"tau1"), det
summ d_empc if inlist(vble,"tau1") & d_empc>0
summ d_empc if inlist(vble,"tau1") & d_empc<0
* 

hist d_empc if inlist(vble,"tau2")
summ d_empc if inlist(vble,"tau2"), det
summ d_empc if inlist(vble,"tau2") & d_empc>0
summ d_empc if inlist(vble,"tau2") & d_empc<0
* 

hist d_empc if inlist(vble,"tau3")
summ d_empc if inlist(vble,"tau3"), det
summ d_empc if inlist(vble,"tau3") & d_empc>0
summ d_empc if inlist(vble,"tau3") & d_empc<0
* 

hist d_empc if inlist(vble,"tau4")
summ d_empc if inlist(vble,"tau4"), det
summ d_empc if inlist(vble,"tau4") & d_empc>0
summ d_empc if inlist(vble,"tau4") & d_empc<0
* 

hist d_empc if inlist(vble,"tau5")
summ d_empc if inlist(vble,"tau5"), det
summ d_empc if inlist(vble,"tau5") & d_empc>0
summ d_empc if inlist(vble,"tau5") & d_empc<0
* 

hist d_empc if inlist(vble,"tau6")
summ d_empc if inlist(vble,"tau6"), det
summ d_empc if inlist(vble,"tau6") & d_empc>0
summ d_empc if inlist(vble,"tau6") & d_empc<0
* 


// Compare continuous treatment on earnings

gen d_wgc = b_wgc_male - b_wgc_female
hist d_wgc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6")
summ d_wgc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_wgc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_wgc>0
summ d_wgc if inlist(vble,"tau0","tau1","tau2","tau3","tau4","tau5","tau6") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6")
summ d_wgc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6"), det
summ d_wgc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_wgc>0
summ d_wgc if inlist(vble,"tau1","tau2","tau3","tau4","tau5","tau6") & d_wgc<0
* 

hist d_wgc if inlist(vble,"pre1","pre3","pre4","pre5","pre6")
summ d_wgc if inlist(vble,"pre1","pre3","pre4","pre5","pre6"), det
summ d_wgc if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_wgc>0
summ d_wgc if inlist(vble,"pre1","pre3","pre4","pre5","pre6") & d_wgc<0
* 
hist d_wgc if inlist(vble,"pre3","pre4","pre5","pre6")
summ d_wgc if inlist(vble,"pre3","pre4","pre5","pre6"), det
summ d_wgc if inlist(vble,"pre3","pre4","pre5","pre6") & d_wgc>0
summ d_wgc if inlist(vble,"pre3","pre4","pre5","pre6") & d_wgc<0
* 


hist d_wgc if inlist(vble,"tau0")
summ d_wgc if inlist(vble,"tau0"), det
summ d_wgc if inlist(vble,"tau0") & d_wgc>0
summ d_wgc if inlist(vble,"tau0") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau1")
summ d_wgc if inlist(vble,"tau1"), det
summ d_wgc if inlist(vble,"tau1") & d_wgc>0
summ d_wgc if inlist(vble,"tau1") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau2")
summ d_wgc if inlist(vble,"tau2"), det
summ d_wgc if inlist(vble,"tau2") & d_wgc>0
summ d_wgc if inlist(vble,"tau2") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau3")
summ d_wgc if inlist(vble,"tau3"), det
summ d_wgc if inlist(vble,"tau3") & d_wgc>0
summ d_wgc if inlist(vble,"tau3") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau4")
summ d_wgc if inlist(vble,"tau4"), det
summ d_wgc if inlist(vble,"tau4") & d_wgc>0
summ d_wgc if inlist(vble,"tau4") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau5")
summ d_wgc if inlist(vble,"tau5"), det
summ d_wgc if inlist(vble,"tau5") & d_wgc>0
summ d_wgc if inlist(vble,"tau5") & d_wgc<0
* 

hist d_wgc if inlist(vble,"tau6")
summ d_wgc if inlist(vble,"tau6"), det
summ d_wgc if inlist(vble,"tau6") & d_wgc>0
summ d_wgc if inlist(vble,"tau6") & d_wgc<0
* 
